home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2003 November / PCWK1103B.iso / DesignCAD 3D Max PLUS trial 30 / DATA1.CAB / Example_Files / Sample_Macros / Double-Line and Door.d3m < prev    next >
Encoding:
Text File  |  2003-09-29  |  1.8 KB  |  81 lines

  1. ' This macro starts a new DesignCAD drawing, then draws a 20 foot
  2. ' long line, offsets it for an interior wall width, then asks the
  3. ' user for the door width.  It then allows the user to snap to
  4. ' the bottom of the wall, and uses that point to break the wall.
  5. ' It breaks a hole in the wall for the width the user wanted,
  6. ' caps both breaks in the wall, then draws the door symbol with 
  7. ' an angled line and an arc.
  8. ' Open a new Drawing
  9.     >New
  10.     {
  11.     }
  12. ' Draw a 20 foot long wall
  13.     >Line
  14.     {
  15.     <pointxyz 0, 0, 0
  16.     <pointpolar 20, 0, 0
  17.     }
  18. ' Select the entire drawing
  19.     >SelectAll
  20.     {
  21.     }
  22. ' Offset wall 6 inches
  23.     >Parallel
  24.     {
  25.     <pointxyz 0, 0, 0
  26.     <pointxyz 0, .5, 0
  27.     }
  28. ' Fit results to Window
  29.     >FitToWindow
  30.     {
  31.     }
  32. ' Ask User for Door Width, (not thickness)
  33. ' Un-remark these next 2 lines to make the input box appear in the upper 
  34. ' left corner of the DesignCAD window, so it does not cover the drawing area.
  35.     ' Sys(130) = 5
  36.     ' Sys(131) = 5
  37. ' Get Distances from user
  38.     Input "What's the Door's Width, (not wall thickness)", wide
  39. ' Ask user to set a point for the Door's left base point
  40.     setpoint "Snap to the bottom of the wall with the line snap, (K) for the Door's left corner", 1
  41. ' Get that point the user set
  42.     getxy x1 y1 z1
  43. ' Cut Wall Section out
  44.     >SectionDeleteCut
  45.     {
  46.     <Pointxyz [x1], [y1 + 5], 0
  47.     <Pointxyz [x1 + wide], [y1 - 5], 0
  48.     }
  49. ' Cap off the left line
  50.     >Line
  51.     {
  52.     <pointxyz [x1], [y1], 0
  53.     <gravity [x1], [.5], 0
  54.     }
  55. ' Cap off the right line
  56.     >Line
  57.     {
  58.     <pointxyz [x1+wide], [y1], 0
  59.     <gravity [x1+wide], [.5], 0
  60.     }
  61. ' Draw the Door's Line
  62.     >Line
  63.     {
  64.     <pointxyz [x1], [y1], 0
  65.     <PointPolar [wide], 45, 0
  66.     }
  67. ' Draw the Door's Arc
  68.     >Arc
  69.     {    
  70.     <Angle 45
  71.     <Type 0
  72.     <pointxyz [x1], [y1], 0
  73.     <pointxyz [x1+wide],[y1], 0
  74.     }
  75. ' Done
  76.     End
  77.  
  78.     
  79.  
  80.